package cn.iocoder.yudao.module.pickbook.dal.mysql.series;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pickbook.dal.dataobject.series.SeriesDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pickbook.controller.admin.series.vo.*;
import org.springframework.data.repository.query.Param;

/**
 * 绘本系列 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface SeriesMapper extends BaseMapperX<SeriesDO> {

    default PageResult<SeriesDO> selectPage(SeriesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SeriesDO>()
                .eqIfPresent(SeriesDO::getTitle, reqVO.getTitle())
                .eqIfPresent(SeriesDO::getDescription, reqVO.getDescription())
                .eqIfPresent(SeriesDO::getLanguage, reqVO.getLanguage())
                .orderByDesc(SeriesDO::getId));
    }

    SeriesDO selectByTitle(@Param("title") String title);

}